package com.ifish.leetcode;

import com.ifish.leetcode.problem.BaseLeetCodeProblem;
import com.ifish.leetcode.problem.algorithm.*;

import org.junit.Test;

import java.util.Date;

public class LeetCodeUnitTest {

    @Test
    public void leetCodeRunnerOnce() {
        new _0012().run();
    }

    @Test
    public void leetCodeRunner() {
        BaseLeetCodeProblem problem = new _0012();
        Date startDate = new Date(System.currentTimeMillis());
        for (int i = 0; i < 100000; i++) {
            problem.setNeedLog(false);
            problem.run();
        }
        Date endDate = new Date(System.currentTimeMillis());
        long diff = endDate.getTime() - startDate.getTime();
        System.out.print(String.format("runtime: %d ms", diff));
    }
}
